#ifndef AVALON_MOCKSERVICELOCATORCLIENTCOMPONENTS_HPP
#define AVALON_MOCKSERVICELOCATORCLIENTCOMPONENTS_HPP
#include "Avalon/IOTests/IOTests.hpp"
#include "Avalon/ServiceLocator/ServiceLocator.hpp"
#include "Avalon/ServiceLocatorTests/ServiceLocatorTests.hpp"

namespace Avalon {
namespace ServiceLocator {
namespace Tests {

  /*! \class MockServiceLocatorClientComponents
   *  \brief Contains components needed to create a mock ServiceLocator client.
   *  \author Kamal Mansouri <kranar@hotmail.com>
   */
  class MockServiceLocatorClientComponents {
    public:

      //! Constructs the MockServiceLocatorClientComponents.
      /*!
        \param server The mock server components to connect this client to.
      */
      MockServiceLocatorClientComponents(
        MockServiceLocatorServerComponents* server);

      ~MockServiceLocatorClientComponents();

      //! Returns the MockClientChannel.
      IO::Tests::MockClientChannel& GetClientChannel();

      //! Returns the ServiceLocatorClient component.
      ServiceLocatorClient& GetClient();

      //! Establishes a valid connection to the ServiceLocatorServer.
      void EstablishValidConnection();

    private:
      friend class MockServiceLocatorServerComponents;
      MockServiceLocatorServerComponents* m_server;
      IO::Tests::MockClientChannel* m_clientChannel;
      boost::scoped_ptr<ServiceLocatorClient> m_client;
  };
}
}
}

#endif // AVALON_MOCKSERVICELOCATORCLIENTCOMPONENTS_HPP
